package asava.trees;

import asava.utils.Position;

/**
 * @author Tim Richter
 */
public abstract class Tree {
    private Position pos;

    /**
     * @return the position of this tree
     */
    public Position pos() {
        return pos;
    }

    /**
     * sets the position of this tree.
     *
     * @param pos position
     * @return this
     */
    public Tree pos(final Position pos) {
        this.pos = pos;
        return this;
    }

    /**
     * @return the kind of this tree
     * @see TreeKind
     */
    public abstract int kind();

    /**
     * accepts the given visitor.
     *
     * @param visitor visitor
     */
    public abstract void accept(final TreeVisitor visitor);
}
